package com.glsc.ngateway.common.base.domain.mysql.gateway.other;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDateTime;

/**
 * @author weizt
 * @date 2023/05/08
 * 自有资金交易账户开立、变更、注销流程所有信息
 */
@Data
@Entity
@Table(name = "t_gw_trade_account_share_holder")
@org.hibernate.annotations.Table(appliesTo = "t_gw_trade_account_share_holder",comment = "自有资金交易账户开立、变更、注销流程所有信息")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class TradeAccountShareHolder {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column(name = "request_id")
    private String requestId;

    @Column(name = "share_holder_account")
    private String shareHolderAccount;

    @Column(name = "share_holder_account_name")
    private String shareHolderAccountName;

    @Column(name = "market")
    private String market;

    @Column(name = "status")
    private String status;

    @Column(name = "share_holder_use_department")
    private String shareHolderUseDepartment;

    @Column(name = "share_holder_use_department_id")
    private Integer shareHolderUseDepartmentId;

    @Column(name = "fund_index")
    private String fundIndex;

    @Column(name = "fund_name")
    private String fundName;

    @Column(name = "trad_unit")
    private Integer tradUnit;

    @Column(name = "trad_unit_num")
    private String tradUnitNum;

    @Column(name = "open_date")
    private String openDate;

    @Column(name = "remark1")
    private String remark1;

    @Column(name = "status_select_name")
    private String statusSelectName;

    @Column(name = "market_select_name")
    private String marketSelectName;

    @Column(name = "data_status" , columnDefinition = "int(2) DEFAULT 0 COMMENT '0 使用，1 停用'")
    private Integer dataStatus = 0;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

}

